package cn.com.dal.dao.impl.hr;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.com.dal.dao.hr.RoleDAO;
import cn.com.dal.dataobject.hr.RoleDO;
import cn.com.support.dal.DAOException;
import cn.com.support.dal.DefaultDAO;

@Repository
public class RoleDAOImpl<T extends RoleDO> extends DefaultDAO<T> implements
		RoleDAO<T> {

	@Override
	protected String getSatementPackage() {
		return "cn.com.dal.dao.hr.RoleDAO";
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<RoleDO> selectRoleByUsername(String username) throws DAOException {
		try {
			return getSqlSession().selectList(
					getSatementPackage() + ".selectRoleByUsername", username);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

}
